home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / archiver / pdtar.zip / NDIR.H < prev    next >
C/C++ Source or Header  |  1987-03-08  |  1KB  |  54 lines

  1. /* @(#)ndir.h    1.4    4/16/85 */
  2. #ifndef DEV_BSIZE
  3. #define    DEV_BSIZE    512
  4. #endif
  5. #define DIRBLKSIZ    DEV_BSIZE
  6. #define    MAXNAMLEN    255
  7.  
  8. struct direct
  9. {
  10.         long d_ino;                /* inode number of entry */
  11.         short d_reclen;            /* length of this record */
  12.         short d_namlen;            /* length of string in d_name */
  13.         char d_name[MAXNAMLEN + 1];        /* name must be no longer than this */
  14. };
  15.  
  16. /*
  17.  * The DIRSIZ macro gives the minimum record length which will hold
  18.  * the directory entry.  This requires the amount of space in struct direct
  19.  * without the d_name field, plus enough space for the name with a terminating
  20.  * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
  21.  */
  22.  
  23. #ifdef DIRSIZ
  24. #undef DIRSIZ
  25. #endif                            /* DIRSIZ */
  26. #define DIRSIZ(dp) \
  27.     ((sizeof (struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
  28.  
  29. /*
  30.  * Definitions for library routines operating on directories.
  31.  */
  32. typedef struct _dirdesc
  33. {
  34.     char whichdir[256]; /* pathname used to open directory */
  35.  
  36.     struct dosdir        /* DOS directory-search structure  */
  37.     {
  38.         char    doshdr[21];
  39.         char    attrib;
  40.         short    time;
  41.         short    date;
  42.         short    size_l;
  43.         short    size_h;
  44.         char    name[13];
  45.     } dosdir;
  46. } DIR;
  47.  
  48. #ifndef NULL
  49. #define NULL 0
  50. #endif
  51. extern DIR *opendir();
  52. extern struct direct *readdir();
  53. extern void closedir();
  54.